package com.echo.fm.platform.auth;

import java.util.List;

import org.hibernate.criterion.Criterion;

import com.echo.fm.content.systemAction.model.SystemAction;
import com.echo.fm.platform.auth.model.Authority;
import com.echo.fm.platform.auth.model.LoginPass;
import com.echo.fm.platform.auth.model.RoleAuth;
import com.echo.fm.platform.auth.model.SystemUser;
import com.echo.fm.user.role.model.Role;
import com.echo.util.ErrorException;


public interface IAuthPersistence {

	SystemUser searchSystemUserByUsername(String userName) throws ErrorException;

	boolean checkPassword(String uid, String password) throws ErrorException;

	void registSystemUser(SystemUser systemUser) throws ErrorException;
	
	Authority searchAuthorityByToken(String token) throws ErrorException;
	
	Authority searchAuthorityByUId(String uid) throws ErrorException;
	
	List<Authority> searchAuthorityList() throws ErrorException;
	 
	List<Authority> searchAuthorityList(boolean isTest) throws ErrorException;
	
	void updateAuthority(Authority authority) throws ErrorException;
	
	String searchUserIdByUsername(String username) throws ErrorException;
	
	LoginPass searchLoginPassByUId(String userId) throws ErrorException;
	
	List<RoleAuth> listRoleAuth(Integer roleId) throws ErrorException;
	
	List<Role> searchRoleList(List<Criterion> criterions) throws ErrorException;
	
	List<Role> searchRoleList(SystemUser user) throws ErrorException;
	
	boolean checkLogin(String id,String password) throws ErrorException;
	
	List<SystemAction> getAllSystemActions() throws ErrorException;
	
	boolean checkAppuser(String uid,String password)throws ErrorException;
	
	
	

}
